/*--------------------------------------------------------------------------------------*\
**
** adv_altar.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#ifndef ADV_ALTAR_H_INCLUDED
#define ADV_ALTAR_H_INCLUDED

#include "adv_object_type.h"
#include "linkage_data.h"
#include "skill.h"
#include "skill_set.h"
#include "stationary_adventure_object.h"

class t_hero;

class t_adv_altar : public t_stationary_adventure_object
{

public:
        
	t_adv_altar(  std::string const& source, t_qualified_adv_object_type const& type );
	t_adv_altar( t_skill_type skill );
	virtual void    activate_trigger( t_army* army, t_adv_map_point const& point, 
		                                   t_direction direction, t_adventure_frame* frame );
	virtual float	ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;
	virtual bool    read( std::streambuf&						stream, 
					      t_qualified_adv_object_type const&	type,
					      int									version );
	virtual bool    write( std::streambuf& stream ) const;

protected:
    t_skill_type    m_altar_type;

 	void			select_skill_for_computer( t_army& army );
};

class t_random_altar : public t_stationary_adventure_object
{
public:
	t_random_altar( std::string const& model_name );
	virtual bool		read_from_map( std::streambuf &		buffer,
							           t_progress_handler * );
	virtual void		place( t_adventure_map& map, t_adv_map_point const& point );
	virtual bool        preplacement( t_adventure_map& map, int pass );

private:
	t_primary_skill_set m_available_skills;
	t_linkage_data		m_linkage_info;
	t_skill_type		m_skill; // Chosen in preplacement()
};


t_skill_type hero_can_learn_more_skill( t_skill_type altar_skill, t_hero const* hero );

#endif // ADV_ALTAR_H_INCLUDED
